package com.video.myvideo;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.bumptech.glide.Glide;

import cn.jzvd.Jzvd;
import cn.jzvd.JzvdStd;


/**
 * Created by LH on 2022-04-06.
 * Time: 2022-04-06  15:19
 */
public class FirstActivity extends AppCompatActivity {

    JzvdStd jzNoTitle;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_first);

        jzNoTitle=findViewById(R.id.jz_notitle);
        jzNoTitle.setUp(UrlsKt.getVideos()[3], UrlsKt.getTitles()[3]);
        Glide.with(this).load(UrlsKt.getThumbnails()[3]).into(jzNoTitle.posterImageView);
    }


    @Override
    protected void onResume() {
        super.onResume();
        Jzvd.goOnPlayOnResume();
    }

    @Override
    protected void onPause() {
        super.onPause();
        JzvdStd.goOnPlayOnPause();
    }

    @Override
    public void onBackPressed() {
        if (JzvdStd.backPress()) {
            return;
        }
        super.onBackPressed();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        JzvdStd.releaseAllVideos();

    }
}
